/**
 * 用户登陆相关接口
 */
import request from '@/utils/request.js'

/**
 * 用户登录
 */
export const login = (username, password) => {
  return request({
    url: '/auth/login',
    method: 'POST',
    data: {
      username, password
    },
  })
}

// 获取当前登录用户的权限信息
export const logout = () => {
  return request({
    url: '/auth/logout',
    method: 'DELETE',
  })
}

// 获取当前登录用户的权限信息
export const getInfo = () => {
  return request({
    url: '/system/user/getInfo',
    method: 'GET',
  })
}

// 获取当前用户的路由权限
export const getRouters = () => {
  return request({
    url: '/system/menu/getRouters',
    method: 'GET',
  })
}